package com.lqd.demo.springboot;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageHelper;
import com.lqd.demo.springboot.orm.mybatis.bean.UserLoginLog;
import com.lqd.demo.springboot.orm.mybatis.service.UserLoginLogMyBatisService;

@RestController
public class MybatisController {

	@Autowired
	private UserLoginLogMyBatisService userLoginLogService ;
	
	@RequestMapping("/mybatis/getByName")
	public List<UserLoginLog> getByName(String name)
	{
		PageHelper.startPage(1, 3);
		return userLoginLogService.getByName(name);
	}
	
	@RequestMapping("/mybatis/save")
	public UserLoginLog save(UserLoginLog userLoginLog)
	{
		userLoginLogService.save(userLoginLog);
		return userLoginLog;
	}
}
